using System.Collections.Generic;
using System.Data;
using SqlSugar;

namespace SqlSugarEx
{
	public class QueryableProviderEx<T> : QueryableProvider<T>
	{
		private AdoProvider _adoProvider;

		public QueryableProviderEx(AdoProvider adoProvider)
		{
			this._adoProvider = adoProvider;
		}

		public override List<T> ToList()
		{
			return base.ToList();
		}

		public override DataTable ToDataTable()
		{
			base.InitMapping();
			KeyValuePair<string, List<SugarParameter>> keyValuePair = this.ToSql();
			base.RestoreMapping();
			SugarParameter[] parameters = base.Context.Ado.GetParameters(keyValuePair.Value);
			return this._adoProvider.GetDataTable(keyValuePair.Key, parameters);
		}
	}
}
